<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script src="static/jquery.min.js"></script>
    <script src="static/codehandle.js"></script>
	<title>Demo</title>

<script type="text/JavaScript" language="javascript">
function StartDevice(){
	var obj = document.getElementById("TestOcx");
	var ret = obj.Start();
	if(ret=='0')
		alert("打开设备成功！");
	else
		alert("打开设备失败！");
}
function HttpDownload(downloadurl,timeout){
	var obj = document.getElementById("TestOcx");
	var ret = obj.CapacitiveSignatureWithHttpDownload(downloadurl,timeout);
	if(ret!='0')
		alert("下载网页失败");
}
function ShowHtml(timeOut,html,isUrl){
	var obj = document.getElementById("TestOcx");
	var ret = obj.ShowInformation(timeOut,html,isUrl);
	if(ret!='0')
		alert("网页展示失败！");
}
function BeginSig(isSuccess,actionResult,picbase64,errorMsg){
	var obj = document.getElementById("TestOcx");
	obj.OnCapacitiveSignatureCompleted(isSuccess,actionResult,picbase64,errorMsg);
}
function evaluate(key,timeout){
	var obj = document.getElementById("TestOcx");
	var ret = obj.Evaluate(key,timeout);
	if(ret!='0')
		alert("打开评价窗口失败！");
}
function GetEvaluate(){
	var obj = document.getElementById("TestOcx");
	var result = obj.GetEvaluateValue();
	alert(result);
}
function logquit(){
	var obj = document.getElementById("TestOcx");
	var ret = obj.Logout();
	if(ret!='0')
		alert("打开评价窗口失败！");
}
function StopService(){
	var obj = document.getElementById("TestOcx");
	var ret = obj.StopService();
	if(ret!='0')
		alert("打开评价窗口失败！");
}
function RestoreService(){
	var obj = document.getElementById("TestOcx");
	var ret = obj.RestoreService();
	if(ret!='0')
		alert("打开评价窗口失败！");
}
function Close(){
	var obj = document.getElementById("TestOcx");
	var ret = obj.Close();
	if(ret!='0')
		alert("打开评价窗口失败！");
}
</script>
</head>
<!---------------------------------------------------------7117F98E-9BE0-43F4-8C4C-68EBE1DD8806--------->
<!-------------------------------------------------------{ 0x5942BB66, 0xC3B, 0x4B5C, { 0x8E, 0x85, 0xB2, 0x6E, 0x1D, 0x72, 0x58, 0xBF } };--------------->
<object id="TestOcx" width="32" height="32" classid="clsid:5942BB66-0C3B-4B5C-8E85-B26E1D7258BF" CODEBASE="<%=request.getContextPath()%>\OCX_SigAndEvaluate.ocx#version=1.0">
</object>

<body>

<center>
    <h1>SigAndEvaluate OF Triple GOLD BEAM SHIELD</h1>

	<div style="padding:10px;text-align: center;width: 250px;border-radius: 5px;border:3px solid grey;float: left; margin-left: 15px;">
	<br>
    <input type="button" class="btn btn-primary" value="打开设备" onclick="StartDevice()">
	 </div>
	<div style="padding:10px;text-align: center;width: 250px;border-radius: 5px;border:3px solid grey;float: left; margin-left: 15px;">
	<br>
    <input type="button" class="btn btn-primary" value="下载http网页并显示" onclick="HttpDownload('www.baidu.com',1)"> 
	</div>
	<div style="padding:10px;text-align: center;width: 250px;border-radius: 5px;border:3px solid grey;float: left; margin-left: 15px;">
	<br>
    <input type="button" class="btn btn-primary" value="显示信息" onclick="ShowHtml(60,'www.baidu.com',1)">
	 </div>
	<div style="padding:10px;text-align: center;width: 250px;border-radius: 5px;border:3px solid grey;float: left; margin-left: 15px;">
	<br>
    <input type="button" class="btn btn-primary" value="签名" onclick="BeginSig(0,0,'',0)">
	 </div>
	<div style="padding:10px;text-align: center;width: 250px;border-radius: 5px;border:3px solid grey;float: left; margin-left: 15px;">
	<br>
    <input type="button" class="btn btn-primary" value="评价功能" onclick="evaluate(1,1)">
	 </div>
	<div style="padding:10px;text-align: center;width: 250px;border-radius: 5px;border:3px solid grey;float: left; margin-left: 15px;">
	<br>
    <input type="button" class="btn btn-primary" value="获取评价结果" onclick="GetEvaluate()"> 
	 </div>
	<div style="padding:10px;text-align: center;width: 250px;border-radius: 5px;border:3px solid grey;float: left; margin-left: 15px;">
	<br>
    <input type="button" class="btn btn-primary" value="用户退出" onclick="logquit()">
	 </div>
	<div style="padding:10px;text-align: center;width: 250px;border-radius: 5px;border:3px solid grey;float: left; margin-left: 15px;">
	<br>
    <input type="button" class="btn btn-primary" value="设备暂停服务" onclick="StopService()">
	 </div>
	<div style="padding:10px;text-align: center;width: 250px;border-radius: 5px;border:3px solid grey;float: left; margin-left: 15px;">
	<br>
    <input type="button" class="btn btn-primary" value="取消暂停服务器" onclick="RestoreService()">
	 </div>
	<div style="padding:10px;text-align: center;width: 250px;border-radius: 5px;border:3px solid grey;float: left; margin-left: 15px;">
	<br>
    <input type="button" class="btn btn-primary" value="关闭设备" onclick="Close()"> 
	 </div>
	
	
<div>
	

</div>
    <div style="clear:both;">
    <br>
    <img id="fin" height="300" src="">
    </div>
</center>
</body>
</html>